#pragma once

class C_SQLiteQuery;

class C_SQLite
{
private:
	sqlite3*	m_instance;
	std::string m_path;
	bool		m_dbOpen;

	bool checkError(int error);
public:
	C_SQLite();
	~C_SQLite();

	void createIfNotExist(std::string filename, C_SQLiteQuery *query);
	void exec(std::string query, int count = 1);
	void execStmt(std::string query, sqlite3_stmt* &statement);

	static int callback(void *pArg, int argc, char **argv, char **columnNames);

	friend class C_SQLiteQuery;
};

#define SQLE(command) if(!checkError(command)) { throw std::runtime_error("SQLite ERROR!\n"); }

